home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / dev / m2 / ModGen.lha / ModGen / Source / NoFragLib.def < prev    next >
Text File  |  1995-04-20  |  3KB  |  91 lines

  1. (* (*----------------------------------------------------------------------
  2.   :Program.     NoFragLib
  3.   :Contents.    Interface to Jan van den Baard's Library
  4.   :Author.      Kai Bolay [kai]
  5.   :Address.     Snail-Mail:              E-Mail:
  6.   :Address.     Hoffmannstraße 168       UUCP: kai@amokle.stgt.sub.org
  7.   :Address.     D-7250 Leonberg 1        FIDO: 2:2407/106.3
  8.   :History.     v1.0 [kai] 15-Feb-91 (translated from C)
  9.   :History.     v1.0 [kai] 13-Feb-93 (recompiled + bug-fixes)
  10.   :History.     v1.0m [Frank Lömker] 13-Feb-93 (Umsetzung nach Modula)
  11.   :History.     v1.0t [Frank Lömker] 17-Apr-95 (Umsetzung nach Turbo Modula)
  12.   :Copyright.   FD
  13.   :Language.    Modula-2
  14.   :Translator.  Turbo Modula-2 V1.40
  15. ----------------------------------------------------------------------*) *)
  16.  
  17. DEFINITION FOR LIBRARY MODULE NoFragLib;
  18.  
  19. FROM SYSTEM IMPORT ADDRESS,LONGSET;
  20. FROM Exec IMPORT Library;
  21.  
  22. CONST
  23.   noFragVersion = 2;
  24.   noFragRevision = 2;
  25.   noFragName = "nofrag.library";
  26.  
  27. TYPE
  28.   noFragBasePtr = POINTER TO noFragBase;
  29.   noFragBase = RECORD
  30.     libNode: Library;
  31.   END;
  32.  
  33. (*
  34.  * ALL structures following are PRIVATE! DO NOT USE THEM!
  35.  *)
  36.   MemoryBlockPtr = POINTER TO MemoryBlock;
  37.  
  38.   MemoryBlock = RECORD
  39.     next, previous: MemoryBlockPtr;
  40.     requirements: LONGSET;
  41.     bytesUsed: LONGINT;
  42.   END;
  43.  
  44.   MemoryItemPtr = POINTER TO MemoryItem;
  45.  
  46.   MemoryItem = RECORD
  47.     next, previous: MemoryItemPtr;
  48.     block: MemoryBlockPtr;
  49.     size: LONGINT;
  50.   END;
  51.  
  52.   BlockListPtr = POINTER TO BlockList;
  53.  
  54.   BlockList = RECORD
  55.     first, end, last: MemoryBlockPtr;
  56.   END;
  57.  
  58.   ItemListPtr = POINTER TO ItemList;
  59.  
  60.   ItemList = RECORD
  61.     first, end, last: MemoryItemPtr;
  62.   END;
  63.  
  64. (*
  65.  * This structure may only be used to pass on to the library routines!
  66.  * It may ONLY be obtained by a call to "GetMemoryChain()"
  67.  *)
  68.  
  69.   MemoryChainPtr = POINTER TO MemoryChain;
  70.  
  71.   MemoryChain = RECORD
  72.     block: BlockList;
  73.     items: ItemList;
  74.     blockSize: LONGINT;
  75.   END;
  76.  
  77. CONST MinAlloc = SIZE (MemoryItem);
  78.  
  79. VAR NoFragBase:noFragBasePtr;
  80.  
  81. PROCEDURE GetMemoryChain (blocksize: LONGINT): MemoryChainPtr;
  82. PROCEDURE AllocItem (chain: MemoryChainPtr; size: LONGINT;
  83.                      requirements: LONGSET): ADDRESS;
  84. PROCEDURE FreeItem (chain: MemoryChainPtr; memptr: ADDRESS; size: LONGINT);
  85. PROCEDURE FreeMemoryChain (chain: MemoryChainPtr; all: BOOLEAN);
  86. PROCEDURE AllocVecItem (chain: MemoryChainPtr; size: LONGINT;
  87.                         requirements: LONGSET): ADDRESS;
  88. PROCEDURE FreeVecItem (chain: MemoryChainPtr; memptr: ADDRESS);
  89.  
  90. END NoFragLib.
  91.